﻿Imports DTO
Imports System.Data.OleDb
Public Class ChucVuDAO
    Public Function laychucvu() As List(Of ChucVuDTO)
        Dim sql = "select MaChucVu,TenChucVu from ChucVu"
        Dim con As OleDbConnection = DatabaseProvider.connectData()
        Dim cmd As New OleDbCommand(sql, con)
        Dim reader As OleDbDataReader = cmd.ExecuteReader()
        Dim danhsach As New List(Of ChucVuDTO)
        While reader.Read()
            Dim cvDTO As New ChucVuDTO()
            cvDTO.MaChucVu = reader("MaChucVu")
            cvDTO.TenChucVu = reader("TenChucVu")
            danhsach.Add(cvDTO)
        End While
        con.Close()
        Return danhsach
    End Function
End Class
